package com.md.album.ui;

import android.content.Intent;

import com.md.album.utils.AlbumUtil;
import com.md.network.api.Album;
import com.md.network.api.Audio;

import java.util.ArrayList;

public class SelectAudioToAlbumFragment extends AbstractSelectAudioFragment {
    @Override
    protected void initData() {
        Intent intent = getActivity().getIntent();
        Album album = intent.getParcelableExtra(AbstractSelectAudioActivity.SELF_ALBUM);
        ArrayList<Audio> audios = intent.getParcelableArrayListExtra(SelectAudioToAlbumActivity.SELECT_AUDIOS);
        if (album != null){
            AlbumUtil.INSTANCE.fillAudioData(album,audios);
        }
        if (audios !=null){
            audioList.clear();
            audioList.addAll(audios);
            taskItemAdapter.setNewInstance(audioList);
        }
    }
}
